<?php
//register the helpers (ajax request)
Core_View_RegisterHelpers::register($this);

if (is_array($this->allowedTemplates)) {?>
<h3><?php echo $this->getTranslation('Step 2: What type of page would you like to create?')?></h3>
<dl>
    <?php
    //load the common helpers
    Core_View_RegisterHelpers::register($this);
    echo $this->FormRow(
        $this->getTranslation('Select a type', null, $this),
        $this->formSelect('contentType', $this->createPageOptions->contentType, null, $this->allowedTemplates) .
        $this->formButton('step2button', $this->getTranslation('Next >>', null, $this), array('class' => 'inlineButton'))
    );
?>
</dl>
<?php
} else {?>
<p><?php echo $this->getTranslation('You can not add any pages to this section.', null, $this)?></p>
<?php } ?>

<script type="text/javascript">
$(document).ready(function() {
    $("#step2button").click(function() {
        $("#step3").load('<?php echo $this->getBaseUrl(); ?>/admin/page/create-page-form');
        return false;
    });
});
</script>